package mysocket


import java.io.{ObjectInputStream, ObjectOutputStream}
import java.net.Socket


// 客户端
object Client {
  def main(args: Array[String]): Unit = {
    val clientSocket = new Socket("127.0.0.1", 8888)
    println("*******************************************")
    val in = new ObjectInputStream(clientSocket.getInputStream)
    val out = new ObjectOutputStream(clientSocket.getOutputStream)


   // while (true) {
      //val reg = new RegisterMsg("yn", password = "123456")
      //out.writeObject(reg)
      out.writeObject(RegisterMsg("malaoshi","malaoshi123"))
      out.flush()

      val value = in.readObject()
      println(value)

    //}

  }
}
